% Chakram is a subproject of Hexena - Haskell Executable Analyser
% License:			GPL-3
% Maintainer:		Montez Fitzpatrick
% Stability:		Experimental
% Portability:		GHC
% Module:			Hexena.Data.SectionHeader

\begin{code}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
module Hexena.Data.SectionHeader
	(
	-- * Data Structures
	  SectionHeader(..)
	, Section(..)
	) where

import Data.Word

import Data.Label -- Needs 'fclabels'

data SectionHeader = 
	SectionHeader { _sectionList :: [Section] } deriving (Show, Eq, Ord)

data Section = Section
	{ _name :: Word64
	, _virtualSize :: Word32
	, _virtualAddr :: Word32
	, _sizeOfRawData :: Word32
	, _ptrToRawData :: Word32
	, _ptrToRelocations :: Word32
	, _ptrToLineNumbers :: Word32
	, _numOfRelocations :: Word16
	, _numOfLineNumbers :: Word16
	, _characteristics :: Word32
	} deriving (Show, Eq, Ord)

-- | Automatically derive a lens for the Section data type
mkLabels [''SectionHeader, ''Section]
\end{code}
